package miracle.joker.design.command.demo2;

public class UndoCommand implements Command {
    private CommandQueue commandQueue;

    public UndoCommand(CommandQueue commandQueue) {
        this.commandQueue = commandQueue;
    }

    @Override
    public void execute() {
        Command command = commandQueue.popUndoCommand();
        if (command != null) {
            command.undo();
        }
    }

    @Override
    public void undo() {

    }

    @Override
    public void redo() {

    }
}
